package Num4;

public class test {
    public static void main(String[] args) {
        student stu1 = new student("小明", 19, "男");
        student stu2 = new student("小明", 19, "男");
        System.out.println(stu1.toString());
        System.out.println(stu2.toString());
        if (stu1.getAge() == stu2.getAge() && stu1.getName().equals(stu2.getName()) && stu1.getSex().equals(stu2.getSex())) {
            System.out.println("这两个对象是一样的");

        } else{
            System.out.println("不一样两个对象");
        }

    }
}

